import request from "@/utils/request";

export default {
	namespaced: true,
	actions: {
		getUserInfo({
			commit
		}) {
			request({
				url: "system/user/profile",
				method: 'GET'
			}).then(res => {
				uni.setStorageSync('userProfile', res.data);
				commit("setUserId", res.data.user.userId)
			})

		}
	},
	mutations: {
		setUserId(state, num) {
			state.userId = num;
		}
	},
	state: {
		userId: undefined
	},
	getters: {

	}
}